<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>DataStorageTest</title>
		
		<script type="text/javascript">
		
			if (typeof(localStorage) == 'undefined' ) {
				alert('Your browser does not support HTML5 localStorage. Try upgrading.');
			} else {
				try {
					var jsonObj = { 'one': 1, 'two': 2, 'three': 3 };
					localStorage.setItem("name", JSON.stringify(jsonObj)); //saves to the database, "key", "value"
				} catch (e) {
				 	if (e == QUOTA_EXCEEDED_ERR) {
	 	 				 alert('Quota exceeded!'); //data wasn't successfully saved due to quota exceed so throw an error
					}
				}
 	
 				var obj = localStorage.getItem("name");
 				var parsedObj = JSON.parse(obj);
				document.write(parsedObj); //Hello World!
				//localStorage.removeItem("name"); //deletes the matching item from the database
			}
		</script>
	</head>
	<body>
	
	</body>
</html>
